<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="恢复任务提示存在资源残留（适用于1.6.0及后续版本）">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="ZH-CN_TOPIC_0000002053451505">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>恢复任务提示存在资源残留（适用于1.6.0及后续版本）</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="ZH-CN_TOPIC_0000002053451505"></a><a name="ZH-CN_TOPIC_0000002053451505"></a>
  <h1 class="topictitle1">恢复任务提示存在资源残留（适用于1.6.0及后续版本）</h1>
  <div>
   <p>表级恢复过程中，会在目标主机生成辅助数据库实例。当恢复任务结束时，会自动删除生成的辅助数据库实例。当恢复任务详情中存在“恢复任务可能存在资源残留”内容时，需要您手动删除残留资源。</p>
   <div class="section">
    <h4 class="sectiontitle">Linux场景</h4>
    <ol>
     <li id="ZH-CN_TOPIC_0000002053451505__li10370134113596"><a name="ZH-CN_TOPIC_0000002053451505__li10370134113596"></a><a name="li10370134113596"></a><span>确认是否有资源残留在目标主机：</span><p></p>
      <ol type="a">
       <li>登录OceanProtect管理界面。</li>
       <li>在恢复任务详情页上获取辅助数据库实例的SID。</li>
       <li>确认是否有资源残留在主机。
        <ol class="substepthirdol">
         <li>使用PuTTY，登录Oracle数据库主机。</li>
         <li>执行以下命令，切换到<strong>oracle</strong>账户。<pre class="screen">su - oracle</pre></li>
         <li>执行以下命令检查主机上是否存在辅助数据库实例相关资源。其中<em>辅助数据库实例SID</em>以<span style="color:#202124;">“hw1726111726”</span>为例。<pre class="screen">find $ORACLE_BASE/ -iname <em>辅助数据库实例SID</em>
find $ORACLE_BASE/* -iname <em>'*<span style="color:#202124;">hw1726111726</span>*'</em> | grep -v admin | grep -v oradata</pre> <p>回显残留资源路径，则说明资源残留。</p> <p>回显如下，表示存在辅助数据库实例<span style="color:#202124;">hw1726111726</span>的残留资源。</p> <pre class="screen">[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$ find $ORACLE_BASE/ -iname <em>hw1726111726</em>
/u01/app/oracle_base/diag/rdbms/hw1726111726
/u01/app/oracle_base/diag/rdbms/hw1726111726/hw1726111726
/u01/app/oracle_base/admin/hw1726111726
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$ find $ORACLE_BASE/* -iname <em>'*hw1726111726*'</em> | grep -v admin | grep -v oradata
/u01/app/oracle_base/dbhome_1/dbs/inithw1726111726.ora
/u01/app/oracle_base/dbhome_1/dbs/hc_hw1726111726.dat
/u01/app/oracle_base/dbhome_1/dbs/lkHW1726111726
/u01/app/oracle_base/dbhome_1/rdbms/log/hw1726111726_ora_11840.trc
/u01/app/oracle_base/dbhome_1/rdbms/audit/hw1726111726_ora_11768_20240912112848327066143795.aud
/u01/app/oracle_base/dbhome_1/rdbms/audit/hw1726111726_ora_11840_20240912112849361156143795.aud
/u01/app/oracle_base/dbhome_1/rdbms/audit/hw1726111726_ora_17518_20240912113510572998143795.aud
/u01/app/oracle_base/dbhome_1/rdbms/audit/hw1726111726_ora_17604_20240912113510751735143795.aud
/u01/app/oracle_base/dbhome_1/rdbms/audit/hw1726111726_ora_23101_20240912113527045619143795.aud
/u01/app/oracle_base/dbhome_1/rdbms/audit/hw1726111726_ora_24116_20240912113531006770143795.aud
......
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$</pre></li>
        </ol></li>
      </ol> <p></p></li>
     <li><span>关闭挂载到主机上的数据库。</span><p></p>
      <ol type="a">
       <li>使用PuTTY，登录Oracle数据库主机。</li>
       <li>执行以下命令，切换到<strong id="ZH-CN_TOPIC_0000002053451505__oracle_gud_0095_b1832916314567">oracle</strong>账户。<p id="ZH-CN_TOPIC_0000002053451505__oracle_gud_0095_p139165195318"><strong id="ZH-CN_TOPIC_0000002053451505__oracle_gud_0095_b86201184533">su - oracle</strong></p></li>
       <li>执行以下命令，清理辅助数据库实例残留资源。其中<em>辅助数据库实例SID</em>以<span style="color:#202124;">“hw1726111726”</span>为例。<pre class="screen">find $ORACLE_BASE/ -iname <em><strong>辅助数据库实例SID</strong></em><em><strong> </strong></em>-exec rm -rf {} \;
find $ORACLE_BASE/* -iname '*<span style="color:#202124;">hw1726111726</span>*' | grep -v admin | grep -v oradata | xargs rm -rf</pre> <p>回显如下，表示辅助数据库实例残留资源已清理，可执行<a href="#ZH-CN_TOPIC_0000002053451505__li10370134113596">1</a>进行验证。</p> <pre class="screen">[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$ find $ORACLE_BASE/ -iname hw1726111726  -exec rm -rf {} \;
find: ‘/u01/app/oracle_base/diag/rdbms/hw1726111726’: No such file or directory
find: ‘/u01/app/oracle_base/admin/hw1726111726’: No such file or directory
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$ find $ORACLE_BASE/ -iname hw1726111726
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$ find $ORACLE_BASE/* -iname '*hw1726111726*' | grep -v admin | grep -v oradata | xargs rm -rf
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$ find $ORACLE_BASE/* -iname '*hw1726111726*' | grep -v admin | grep -v oradata
[oracle@adg1 <font style="font-size:8pt" face="Courier New">~</font>]$</pre></li>
      </ol> <p></p></li>
    </ol>
   </div>
   <div class="section">
    <h4 class="sectiontitle">Windows场景</h4>
    <ol>
     <li><span>登录OceanProtect管理界面，在恢复任务详情页上获取辅助数据库实例的SID。</span></li>
     <li><span>在Windows系统所有程序中搜索Services，在<span class="uicontrol">“Name”</span>列查看是否存在OracleService<em>辅助数据库实例SID</em>。</span><p></p>
      <div class="p">
       若存在，则在键盘上按“Win+R”，打开运行窗口。输入cmd，执行以下命令删除辅助数据库实例。
       <pre class="screen">oradim -delete -sid <em>辅助数据库实例SID</em></pre>
      </div> <p></p></li>
     <li id="ZH-CN_TOPIC_0000002053451505__li137585182072"><a name="ZH-CN_TOPIC_0000002053451505__li137585182072"></a><a name="li137585182072"></a><span>在键盘上按“Win+R”，打开运行窗口。输入regedit，找到ORACLE_BASE和ORACLE_HOME的路径，并妥善保存该路径。</span></li>
     <li id="ZH-CN_TOPIC_0000002053451505__li33752214231"><a name="ZH-CN_TOPIC_0000002053451505__li33752214231"></a><a name="li33752214231"></a><span>在Windows系统所有程序中搜索Windows PowerShell，依次执行以下命令，查找残留资源。其中<em>ORACLE_BASE路径、<em>ORACLE_HOME路径</em></em>分别为<a href="#ZH-CN_TOPIC_0000002053451505__li137585182072">3</a>中获取的路径。</span><p></p><pre class="screen">Get-ChildItem -Path <em>ORACLE_BASE路径</em> -Recurse -File | Where-Object {$_.Name -like "*<em>辅助数据库实例SID</em>*"}</pre> <pre class="screen">Get-ChildItem -Path <em>ORACLE_HOME路径</em> -Recurse -File | Where-Object {$_.Name -like "*<em>辅助数据库实例SID</em>*"}</pre> <p><span><img src="zh-cn_image_0000002085881410.png"></span></p> <p></p></li>
     <li><span>手动确认并删除<a href="#ZH-CN_TOPIC_0000002053451505__li33752214231">4</a>中回显的文件。删除完成后再次执行<a href="#ZH-CN_TOPIC_0000002053451505__li33752214231">4</a>，如果没有回显文件，表示辅助数据库实例残留资源已清理。</span></li>
    </ol>
   </div>
  </div>
 </body>
</html>